import request from '@/utils/request'

export function add(data) {
  return request({
    url: '/code/datasource/add',
    method: 'post',
    data: data
  })
}

export function listTable(id) {
  return request({
    url: '/code/datasource/table/' + id,
    method: 'get'
  })
}

export function list() {
  return request({
    url: '/code/datasource/list',
    method: 'get'
  })
}

export function update(data) {
  return request({
    url: '/code/datasource/update',
    method: 'post',
    data: data
  })
}

export function del(data) {
  return request({
    url: '/code/datasource/del',
    method: 'post',
    data: data
  })
}

export function test(data) {
  return request({
    url: '/code/datasource/test',
    method: 'post',
    data: data
  })
}

export function dbtype() {
  return request({
    url: '/code/datasource/dbtype',
    method: 'post'
  })
}
